/*
 * Warp!! config define
 */
#ifdef CO_LINUX_WARP_ON
	#define CONFIG_WARP
	#define CONFIG_WARP_NAND
	#define CONFIG_WARP_SD
	#define CONFIG_WARP_LOAD_ADDR   warp_load_addr
	#define CONFIG_WARP_SAVENO_NAND 0
	#define CONFIG_WARP_SAVENO_EMMC 1
//	#define CONFIG_WARP_BOOT_CANCEL
#endif

#define WARP_NAND_DEVICE         WARP_DEV(NAND, 0, 0)
#define WARP_NAND_HIBDRV_OFFS_0  0x143c0000
#define WARP_NAND_HIBDRV_OFFS_1  0x163c0000
#define WARP_NAND_HIBDRV_SIZE    0x00040000
#define WARP_NAND_USERAPI_OFFS_0 (WARP_NAND_HIBDRV_OFFS_0+WARP_NAND_HIBDRV_SIZE)
#define WARP_NAND_USERAPI_OFFS_1 (WARP_NAND_HIBDRV_OFFS_1+WARP_NAND_HIBDRV_SIZE)
#define WARP_NAND_USERAPI_SIZE   0x00040000
#define WARP_NAND_BF_OFFS_0      (WARP_NAND_USERAPI_OFFS_0+WARP_NAND_USERAPI_SIZE)
#define WARP_NAND_BF_OFFS_1      (WARP_NAND_USERAPI_OFFS_1+WARP_NAND_USERAPI_SIZE)
#define WARP_NAND_BF_SIZE        0x00040000

#define WARP_EMMC_HIBDRV_OFFS_0  0x000a1a00
#define WARP_EMMC_HIBDRV_OFFS_1  0x000b1a00
#define WARP_HIBDRV_PHYS         0x46200000

#define WARP_EMMC_DEVICE         WARP_DEV(SD, 0, 0)
#define WARP_EMMC_HIBDRV_SIZE    0x00000200
#define WARP_EMMC_USERAPI_OFFS_0 (WARP_EMMC_HIBDRV_OFFS_0+WARP_EMMC_HIBDRV_SIZE)
#define WARP_EMMC_USERAPI_OFFS_1 (WARP_EMMC_HIBDRV_OFFS_1+WARP_EMMC_HIBDRV_SIZE)
#define WARP_EMMC_USERAPI_SIZE   0x00000200
#define WARP_EMMC_BF_OFFS_0      (WARP_EMMC_USERAPI_OFFS_0+WARP_EMMC_USERAPI_SIZE)
#define WARP_EMMC_BF_OFFS_1      (WARP_EMMC_USERAPI_OFFS_1+WARP_EMMC_USERAPI_SIZE)
#define WARP_EMMC_BF_SIZE        0x00000002

#define WARP_HIBDRV_SIZE        0x000c0000
#define WARP_USERAPI_PHYS       (WARP_HIBDRV_PHYS + WARP_HIBDRV_SIZE)

#ifdef CO_LINUX_VERSION_ON //Linux Main use floating

#define WARP_DRV_INFO_NAND_0                                            \
{                                                                       \
    /* Hibernation driver */                                            \
    .mode                       = WARP_DRV_FLOATING,                    \
    .drv.dev                    = WARP_NAND_DEVICE,                     \
    .drv.offs                   = WARP_NAND_HIBDRV_OFFS_0,              \
    .drv.size                   = WARP_NAND_HIBDRV_SIZE,                \
}, {                                                                    \
    /* UserAPI driver */                                                \
    .mode                       = WARP_DRV_FLOATING,                    \
    .drv.dev                    = WARP_NAND_DEVICE,                     \
    .drv.offs                   = WARP_NAND_USERAPI_OFFS_0,             \
    .drv.size                   = WARP_NAND_USERAPI_SIZE,               \
},

#define WARP_DRV_INFO_NAND_1                                            \
{                                                                       \
    /* Hibernation driver */                                            \
    .mode                       = WARP_DRV_FLOATING,                    \
    .drv.dev                    = WARP_NAND_DEVICE,                     \
    .drv.offs                   = WARP_NAND_HIBDRV_OFFS_1,              \
    .drv.size                   = WARP_NAND_HIBDRV_SIZE,                \
}, {                                                                    \
    /* UserAPI driver */                                                \
    .mode                       = WARP_DRV_FLOATING,                    \
    .drv.dev                    = WARP_NAND_DEVICE,                     \
    .drv.offs                   = WARP_NAND_USERAPI_OFFS_1,             \
    .drv.size                   = WARP_NAND_USERAPI_SIZE,               \
},

#define WARP_DRV_INFO_SD_0                                              \
{                                                                       \
    /* Hibernation driver */                                            \
    .mode                       = WARP_DRV_FLOATING,                    \
    .drv.dev                    = WARP_EMMC_DEVICE,                     \
    .drv.offs                   = WARP_EMMC_HIBDRV_OFFS_0,              \
    .drv.size                   = WARP_EMMC_HIBDRV_SIZE,                \
}, {                                                                    \
    /* UserAPI driver */                                                \
    .mode                       = WARP_DRV_FLOATING,                    \
    .drv.dev                    = WARP_EMMC_DEVICE,                     \
    .drv.offs                   = WARP_EMMC_USERAPI_OFFS_0,             \
    .drv.size                   = WARP_EMMC_USERAPI_SIZE,               \
},

#define WARP_DRV_INFO_SD_1                                              \
{                                                                       \
    /* Hibernation driver */                                            \
    .mode                       = WARP_DRV_FLOATING,                    \
    .drv.dev                    = WARP_EMMC_DEVICE,                     \
    .drv.offs                   = WARP_EMMC_HIBDRV_OFFS_1,              \
    .drv.size                   = WARP_EMMC_HIBDRV_SIZE,                \
}, {                                                                    \
    /* UserAPI driver */                                                \
    .mode                       = WARP_DRV_FLOATING,                    \
    .drv.dev                    = WARP_EMMC_DEVICE,                     \
    .drv.offs                   = WARP_EMMC_USERAPI_OFFS_1,             \
    .drv.size                   = WARP_EMMC_USERAPI_SIZE,               \
},

#else //No floating

#define WARP_DRV_INFO_NAND_0                                            \
{                                                                       \
    /* Hibernation driver */                                            \
    .mode                       = WARP_DRV_FIXED,                       \
    .addr                       = WARP_HIBDRV_PHYS,                     \
    .drv.dev                    = WARP_NAND_DEVICE,                     \
    .drv.offs                   = WARP_NAND_HIBDRV_OFFS_0,              \
    .drv.size                   = WARP_NAND_HIBDRV_SIZE,                \
}, {                                                                    \
    /* UserAPI driver */                                                \
    .mode                       = WARP_DRV_FIXED,                       \
    .addr                       = WARP_USERAPI_PHYS,                    \
    .drv.dev                    = WARP_NAND_DEVICE,                     \
    .drv.offs                   = WARP_NAND_USERAPI_OFFS_0,             \
    .drv.size                   = WARP_NAND_USERAPI_SIZE,               \
},

#define WARP_DRV_INFO_NAND_1                                            \
{                                                                       \
    /* Hibernation driver */                                            \
    .mode                       = WARP_DRV_FIXED,                       \
    .addr                       = WARP_HIBDRV_PHYS,                     \
    .drv.dev                    = WARP_NAND_DEVICE,                     \
    .drv.offs                   = WARP_NAND_HIBDRV_OFFS_0,              \
    .drv.size                   = WARP_NAND_HIBDRV_SIZE,                \
}, {                                                                    \
    /* UserAPI driver */                                                \
    .mode                       = WARP_DRV_FIXED,                       \
    .addr                       = WARP_USERAPI_PHYS,                    \
    .drv.dev                    = WARP_NAND_DEVICE,                     \
    .drv.offs                   = WARP_NAND_USERAPI_OFFS_0,             \
    .drv.size                   = WARP_NAND_USERAPI_SIZE,               \
},

#define WARP_DRV_INFO_SD_0                                              \
{                                                                       \
    /* Hibernation driver */                                            \
    .mode                       = WARP_DRV_FIXED,                       \
    .addr                       = WARP_HIBDRV_PHYS,                     \
    .drv.dev                    = WARP_EMMC_DEVICE,                     \
    .drv.offs                   = WARP_EMMC_HIBDRV_OFFS_0,              \
    .drv.size                   = WARP_EMMC_HIBDRV_SIZE,                \
}, {                                                                    \
    /* UserAPI driver */                                                \
    .mode                       = WARP_DRV_FIXED,                       \
    .addr                       = WARP_USERAPI_PHYS,                    \
    .drv.dev                    = WARP_EMMC_DEVICE,                     \
    .drv.offs                   = WARP_EMMC_USERAPI_OFFS_0,             \
    .drv.size                   = WARP_EMMC_USERAPI_SIZE,               \
},

#define WARP_DRV_INFO_SD_1                                              \
{                                                                       \
    /* Hibernation driver */                                            \
    .mode                       = WARP_DRV_FIXED,                       \
    .addr                       = WARP_HIBDRV_PHYS,                     \
    .drv.dev                    = WARP_EMMC_DEVICE,                     \
    .drv.offs                   = WARP_EMMC_HIBDRV_OFFS_1,              \
    .drv.size                   = WARP_EMMC_HIBDRV_SIZE,                \
}, {                                                                    \
    /* UserAPI driver */                                                \
    .mode                       = WARP_DRV_FIXED,                       \
    .addr                       = WARP_USERAPI_PHYS,                    \
    .drv.dev                    = WARP_EMMC_DEVICE,                     \
    .drv.offs                   = WARP_EMMC_USERAPI_OFFS_1,             \
    .drv.size                   = WARP_EMMC_USERAPI_SIZE,               \
},

#endif

#define WARP_SAVEAREA_0                                                 \
{                                                                       \
    .bootflag.dev               = WARP_NAND_DEVICE,                     \
    .bootflag.offs              = WARP_NAND_BF_OFFS_0,                  \
    .bootflag.size              = WARP_NAND_BF_SIZE,                    \
}, {                                                                    \
    .bootflag.dev               = WARP_EMMC_DEVICE,                     \
    .bootflag.offs              = WARP_EMMC_BF_OFFS_0,                  \
    .bootflag.size              = WARP_EMMC_BF_SIZE,                    \
},

#define WARP_SAVEAREA_1                                                 \
{                                                                       \
    .bootflag.dev               = WARP_NAND_DEVICE,                     \
    .bootflag.offs              = WARP_NAND_BF_OFFS_0,                  \
    .bootflag.size              = WARP_NAND_BF_SIZE,                    \
}, {                                                                    \
    .bootflag.dev               = WARP_EMMC_DEVICE,                     \
    .bootflag.offs              = WARP_EMMC_BF_OFFS_0,                  \
    .bootflag.size              = WARP_EMMC_BF_SIZE,                    \
},

extern unsigned char *warp_load_addr;
